package com.hainatong.shiphelper.module.holiday.adapter;

import org.jetbrains.annotations.NotNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.databinding.ItemPortInfoViewBinding;
import com.hainatong.shiphelper.module.holiday.entity.PortBean;

public class PortAdapter extends BaseQuickAdapter<PortBean, BaseDataBindingHolder<ItemPortInfoViewBinding>>
{
    public PortAdapter()
    {
        super(R.layout.item_port_info_view);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemPortInfoViewBinding> bindingHolder, PortBean portBean)
    {
        ItemPortInfoViewBinding binding = bindingHolder.getDataBinding();
        if( binding != null )
        {
            binding.setPort( portBean );
            binding.executePendingBindings();
        }
    }
}
